<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title> - IOS商城——歷史記錄</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	<link href="__STATIC__/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__STATIC__/css/new_file.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h5>IOS商城——歷史記錄</h5>
				</div>
				<div class="toogl_body">
					<a href="Club.html"><button type="button" class="btn btn-w-m btn-bt btn-white">俱樂部管理</button></a>
					<a href="Club_configure.html"><button type="button" class="btn btn-w-m btn-white btn-bt">鑽石配置</button></a>
					<a href="Club_establish.html"><button type="button" class="btn btn-w-m btn-white btn-bt">創建俱樂部</button></a>
					<a href="Club_goldcoin.html"><button type="button" class="btn btn-w-m btn-info btn-bt">金幣配置</button></a>
					<a href="Club_grant.html"><button type="button" class="btn btn-w-m btn-white btn-bt">金幣發放</button></a>
					<a href="Club_conf.html"><button type="button" class="btn btn-w-m btn-white btn-bt">金幣配置</button></a>
					<hr style="clear: both;"/>
					<a href="Club_ios.html"><button type="button" class="btn btn-w-m btn-info btn-bt" data-toggle="modal" data-target="#myModal">IOS商品</button></a>
					<a href="Club_android.html"><button type="button" class="btn btn-w-m btn-white" data-toggle="modal" data-target="#myModal">Android商品</button></a>
					<a href="Club_goldcoin.html"><button type="button" class="btn btn-w-m btn-white" data-toggle="modal" data-target="#myModal">第三方商品</button></a>
					<hr style="clear: both;"/>
					<a href="Club_ios.html"><button type="button" class="btn btn-w-m btn-white" >添加商品</button></a>
					<a href="Club_ios_1.html"><button type="button" class="btn btn-w-m btn-white">歷史記錄</button></a>
					<div class="ibox-content ibox-jqGrid">
						<div class="form-group mmp-gbl"><br/>
							<label class="col-sm-2 control-dy">查詢時間：</label>
							<div class="col-sm-8 form-time1">
								<input type="text" placeholder="請輸入查詢時間段" class="form-control form-time-bk" id="time1" readonly="readonly">
							</div>
							<label class="col-sm-2 control-dy">商品ID：</label>
							<div class="col-sm-8 form-time1">
								<input type="text" placeholder="請輸入商品ID" class="form-control form-time-bk" id="goods_id">
							</div>
							<button type="button" id ="buttonid" class="btn btn-w-m btn-info">查詢</button>
						</div>
						<div class="jqGrid_wrapper">
							<table id="table_list_1"></table>
							<div id="pager_list_1"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 修改  -->
<div id="myModal2" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">商品ID：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control"  readonly="readonly"  id="good_id">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">商品位置：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control"  readonly="readonly"  id="goods_position">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">金幣數量：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control"  readonly="readonly"  id="gold_number">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">贈送金幣數量：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control"  readonly="readonly"  id="gold_give">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">價格：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control"  readonly="readonly" id="price">
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--修改 end-->
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
<script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
<script src="__STATIC__/js/content.js?v=1.0.0"></script>
<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
<script>
    function gold_details(t){
        var id = $(t).parent().parent().children().eq(4).html();//俱乐部id
        var goods_id = $(t).parent().parent().children().eq(1).html();//俱乐部id
        $.ajax({
            type: "post",
            url: "__URL__/gold_details_ios",
            data: {
                'id':id,
                'goods_id':goods_id
            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                var price = e.price/100;
                $('#good_id').val(e.g_goods_id_ios);
                $('#goods_position').val(e.goods_position);
                $('#gold_number').val(e.number);
                $('#price').val(price);
                $('#gold_give').val(e.give);

            },
            error: function(e) {
            }
        });
    }
    $('#buttonid').on('click', function() {     //页面上的button按钮的click事件，重新获取参数后发送参数，然后重新加载数据。
        var Data ={
            time:$("#time1").val(),
            goods_id:$("#goods_id").val(),
        };
        $("#table_list_1").jqGrid('setGridParam',{
            url:'__URL__/gold_operations_ios',
            datatype:'json',
            postData:{
                'time':Data.time,
                'goods_id':Data.goods_id
            },
            page:1
        }).trigger("reloadGrid"); //重新载入

    });
    $(document).ready(function () {

        $('.clo-sj').hide();
        $('.clo-xl').hide();
        $('.form-consele1').on('change',function(){
            if ($('.form-consele1').val() == '0') {
                $('.clo-sj').hide();
            } else{
                $('.clo-sj').show();
            }
        });
        $('.form-consele2').on('change',function(){
            if ($('.form-consele2').val() == '0') {
                $('.clo-xl').hide();
            } else{
                $('.clo-xl').show();
            }
        });
        $.jgrid.defaults.styleUI = 'Bootstrap';

        $("#table_list_1").jqGrid({
            datatype:'json',
            postData:{}, //发送数据
            mtype: 'POST',
            height: 450,
            autowidth: true,
            shrinkToFit: true,
            rowNum: 20,
            rowList: [20,50,100],
            colNames: ['修改時間', '商品ID', '操作人', '操作類型','id', '商品詳情'],
            colModel: [
                {
                    name: 'opera_time',
                    index: 'opera_time',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'g_goods_id_ios',
                    index: 'g_goods_id_ios',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'opera_pepole',
                    index: 'opera_pepole',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'opera_type',
                    index: 'opera_type',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'id',
                    index: 'id',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    hidden :true,
                    align:'center'
                },
                {
                    name: 'opera_type',
                    index: 'opera_type',
                    width: 60,
                    formatter: function(opera_type) {
                        // if(opera_type == "商品删除"){
                        // 	return '商品已被删除,无法查看商品详情';
                        // }else{
                        return '<input type="button" value="詳情" id="" data-toggle="modal" data-target="#myModal2" class="btn btn-info" onclick="gold_details(this)"/>';
                        // }

                    },
                    align:'center'
                }
            ],
            pager: "#pager_list_1",
            viewrecords: true,
            loadonce: true,
            caption: "IOS商城 ；歷史記錄",
            hidegrid: false
        });

        $(window).bind('resize', function () {
            var width = $('.jqGrid_wrapper').width();
            $('#table_list_1').setGridWidth(width);
        });

        laydate.render({
            elem: '#time1'
            ,range: true
        });
        laydate.render({
            elem: '#time2'
            ,range: true
        });
    });
</script>


</body>

</html>